function gets(pageNum) {
    var o = $("#pnumber").val();
    var n = $("#pname").val();
    var m = $("#status").val();
    var l = $("#ph").val();
    var k = $("#lefTime").val();
    var j = $("#rightTime").val();
    var i = $("#dserial").val();
    var h = $("#cname").val();
    var g = $("#dform").val();
    var f = $("#specification").val();
    var e = $("#unit").val();
    var d = $("#cc").val();
    var c = $("#manufacturer").val();
    var b = $("#pdname").val();
    var a = $("#dcid").val();
    var pageN = pageNum;
    $.ajax({
            url: '/myspringboot/DeliveryController/findPurchaseOrder',
            type: 'post',
            dataType: "json",
            data: {
                pnumber: o,
                pname: n,
                status: m,
                ph: l,
                lefTime: k,
                rightTime: j,
                dserial: i,
                cname: h,
                dform: g,
                specification: f,
                unit: e,
                cc: d,
                manufacturer: c,
                pdname: b,
                dcid: a,
                pageNum: pageN,
            },
            success: function (result) {
                var result = result.data;
                yibu(result.pages, result.pageNum);
                var list = result.list;
                $(".a").empty();
                for (var i = 0; i < list.length; i++) {
                    var a = i + 1;
                    var podiId = list[i].podiId;

                    var purchaseOrder = list[i].purchaseOrder;
                    if (purchaseOrder != null) {
                        //采购单编号
                        var pNumber = purchaseOrder.poNumber;
                        //采购单名称
                        var poName = purchaseOrder.poName;
                        //开始采购时间
                        var poSubmissionTime = purchaseOrder.poSubmissionTime;
                        //结束采购时间
                        var poAuditTime = purchaseOrder.poAuditTime;
                    } else {
                        var pNumber = "null"
                        var poName = "null"
                        var poSubmissionTime = "null"
                        var poAuditTime = "null"
                    }
                    //采购医院
                    var hospital = list[i].hospital;
                    if (hospital != null) {
                        var hName = hospital.hName;
                    } else {
                        var hName = "null"
                    }
                    var drugInformation = list[i].drugInformation;
                    if (drugInformation != null) {
                        //药品流水号
                        var diNumer = drugInformation.diNumer;
                        //通用名
                        var diName = drugInformation.diName;
                        //剂型
                        var diForm = drugInformation.diForm;
                        //规格
                        var diSpecifications = drugInformation.diSpecifications;
                        //单位
                        var diUnit = drugInformation.diUnit;
                        //转换系数
                        var diCc = drugInformation.diCc;
                        //中标价
                        var diNewPrice = drugInformation.diNewPrice;
                    } else {
                        var diNumer = "null"
                        var diName = "null"
                        var diForm = "null"
                        var diSpecifications = "null"
                        var diUnit = "null"
                        var diCc = "null"
                        var diNewPrice = "null"
                    }
                    var drugAtegory = list[i].drugAtegory;
                    if (drugAtegory != null) {
                        //商品名
                        var daName = drugAtegory.daName;
                        //供货企业
                        var daSupplier = drugAtegory.daSupplier;
                    } else {
                        var daName = "null"
                        var daSupplier = "null"
                    }
                    //生产企业
                    var manufacturer = list[i].manufacturer;
                    if (manufacturer != null) {
                        var mfName = manufacturer.mfName;
                    } else {
                        var mfName = "null"
                    }
                    //采购量
                    var podiNumber = list[i].podiNumber;
                    //采购总金额
                    var podiTotal = list[i].podiTotal;
                    //采购状态
                    var podiState = list[i].podiState;
                    var tr = '<tr>' +
                        '<td>' + a + '</td>' +
                        '<td><input class="selectItem1" name="sdiId" value=' + podiId + ' type="checkbox">' +
                        '<td>' + pNumber + '</td>' +
                        '<td>' + poName + '</td>' +
                        '<td>' + hName + '</td>' +
                        '<td>' + poSubmissionTime + '</td>' +
                        '<td>' + poAuditTime + '</td>' +
                        '<td>' + diNumer + '</td>' +
                        '<td>' + diName + '</td>' +
                        '<td>' + daName + '</td>' +
                        '<td>' + diForm + '</td>' +
                        '<td>' + diSpecifications + '</td>' +
                        '<td>' + diUnit + '</td>' +
                        '<td>' + diCc + '</td>' +
                        '<td>' + mfName + '</td>' +
                        '<td>' + diNewPrice + '</td>' +
                        '<td>' + diNewPrice + '</td>' +
                        '<td>' + podiNumber + '</td>' +
                        '<td>' + podiTotal + '</td>' +
                        '<td>' + daSupplier + '</td>' +
                        '<td>' + podiState + '</td>' +
                        '</tr>'
                    $(".a").append(tr);
                }
            }
        }
    )
}

//全选
function selectAll(obj) {
    var checkboxEle = document.getElementsByClassName("selectItem1");
    for (var i = 0; i < checkboxEle.length; i++) {
        checkboxEle[i].checked = obj.checked;
    }
}

//获取复选框的值
function show() {
    obj1 = document.getElementsByClassName("selectItem1");
    var sdiI = [];
    for (k in obj1) {
        if (obj1[k].checked)
            sdiI.push(obj1[k].value);
    }
    $.ajax({
        url: '/myspringboot/DeliveryController/reviseState',
        type: 'post',
        dataType: 'json',
        traditional: true,
        data: {
            id: sdiI,
        },
        success: function (result) {
            alert(result.msg)
            window.location.href = "drug07dv.html";
        }
    })
}